#include "uart.h"


//uint8_t i=0;
//uint8_t rxComplete=0;
//uint16_t x1,x2,x3,x4,y1,y2,y3,y4;

//串口重定向
int fputc(int ch, FILE *f)
{
  HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1,0xffff);
  return ch;
}
int fgetc(FILE *fp)
{
  uint8_t ch = 0;
  HAL_UART_Receive(&huart1, &ch, 1, 0xffff);
  return ch;
}

void debug_printf(char *fmt,...)
{
//    static char msg[512];
//    uint32_t cnt;
//    va_list argptr;
//    __va_start(argptr,fmt);
//    cnt=vsnprintf(msg,512,fmt,argptr);
//    __va_end(argptr);
//    HAL_UART_Transmit(&huart1, (uint8_t *)&msg, cnt,0xffff);
    //wait_tx_tc();
}
